public class ForDemo {

	private static final String text = "Hello, World!";
	static final double PI = 3.141592653589793;

	public static void main1() {
		int[] numbers = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
		int sum = 0;
		for (int n : numbers) {
			sum += n;
		}

		System.out.println("Sum is :: " + sum);
	}

	public static void main2() {
		int[] numbers = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
		int sum = 0;
		for (int i = 0; i < numbers.length; i++) {
			sum += numbers[i];
		}

		System.out.println("Sum is :: " + sum);
	}

	public static void main(String[] args) {
		int[] numbers = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
		int sum = 0;
		int i = 0;
		while (i < numbers.length) {
			sum += numbers[i];
			i++;
		}
		System.out.println("Sum is :: " + sum);
	}
}